package cn.echase.ecare.yinfayun.domain.mapper;

import cn.echase.ecare.yinfayun.domain.entity.StaffCertificate;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.time.LocalDate;
import java.util.List;

/**
 * StaffCertificateMapper
 *
 * @auther jiangyilong
 * @date 2025-05-12 09:39
 * @description 机构员工证书表
 */ 
@Mapper
public interface StaffCertificateMapper extends BaseMapperPlus<StaffCertificate, StaffCertificate> {

    /**
     * 查询机构员工证书
     *
     * @param staffCertificateList 机构员工证书
     * @return 机构员工证书
     */
    @InterceptorIgnore(tenantLine = "true")
    int insertStaffCerBatch(List<StaffCertificate> staffCertificateList);


    /**
     * 查询机构员工证书
     *
     * @param id 机构员工证书ID
     * @return 机构员工证书
     */
    @InterceptorIgnore(tenantLine = "true")
    StaffCertificate selectStaffCertificateById(Long id);

    /**
     * 查询机构员工证书列表
     *
     * @param staffCertificate 机构员工证书
     * @return 机构员工证书集合
     */
    @InterceptorIgnore(tenantLine = "true")
    List<StaffCertificate> selectStaffCertificateList(StaffCertificate staffCertificate);

    /**
     * 新增机构员工证书
     *
     * @param staffCertificate 机构员工证书
     * @return 结果
     */
    @InterceptorIgnore(tenantLine = "true")
    int insertStaffCertificate(StaffCertificate staffCertificate);

    /**
     * 修改机构员工证书
     *
     * @param staffCertificate 机构员工证书
     * @return 结果
     */
    @InterceptorIgnore(tenantLine = "true")
    int updateStaffCertificate(StaffCertificate staffCertificate);

    /**
     * 删除机构员工证书
     *
     * @param staffCertificate 机构员工证书ID
     * @return 结果
     */
    @InterceptorIgnore(tenantLine = "true")
    int deleteStaffCertificate(StaffCertificate staffCertificate);

    /**
     * 批量删除机构员工证书
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @InterceptorIgnore(tenantLine = "true")
    int deleteStaffCertificateByIds(String[] ids);

    /**
     * 查询证书7天内到期的员工信息
     *
     * @param orgId       机构ID
     * @param currentDate 日期
     * @return {@link List}<{@link StaffCertificate}>
     */
    @InterceptorIgnore(tenantLine = "true")
    List<StaffCertificate> selectCerByStopDate(@Param("orgId") String orgId, @Param("currentDate") LocalDate currentDate);

    /**
     * 根据提醒周期查询即将到期的证照
     *
     * @param orgId       机构ID
     * @param currentDate 日期
     * @return {@link List}<{@link StaffCertificate}>
     */
    @InterceptorIgnore(tenantLine = "true")
    List<StaffCertificate> selectCerByStopDateAndRemindCycle(@Param("orgId") String orgId, @Param("currentDate") LocalDate currentDate, @Param("configKey") String configKey);

}